package com.ym.mapper;



import com.ym.pojo.Account;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;


/**
 * @version 1.0
 * 公众号：Java架构栈
 * @Author: 卓不凡
 */
public class AccountRowMapper implements RowMapper<Account> {
    //maprow :实体属性和数据库字段的对应
    @Override
    public Account mapRow(ResultSet rs, int rowNum) throws SQLException {
        Account account = new Account();
        account.setId(rs.getInt("id"));
        account.setName(rs.getString("name"));
        account.setMoney(rs.getDouble("money"));
        return account;
    }
}
